﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

namespace sp.netWebFroms
{
    public class DbHelp
    {
        private static readonly string conString = "server=.;database=CMS;uid=sa;password=123456;";

        public static DataTable GetData(string sql)
        {
            SqlDataAdapter adapter = new SqlDataAdapter(sql, conString);
            DataTable dt = new DataTable();
            adapter.Fill(dt);
            return dt;
        }
        public static void COC(string sql)
        {
            SqlConnection connection = new SqlConnection(conString);
            SqlCommand command = new SqlCommand(sql, connection);

            connection.Open();
            command.ExecuteNonQuery();
            connection.Close();
        }
    }

}